Function: setAttribute(domElementOrNodeArrayOrCSSSelector, stringAttributeNameOrKeyValueMap, value) Shorthand: setAttr(domElementOrNodeArrayOrCSSSelector, stringAttributeNameOrKeyValueMap, value) Description: Sets the specified attributes for a DOM element, markup string, or CSS selector referenced element. Returns: domElement or matching node array, or $A object if chained. Example: // Set an attribute on a DOM element var myElement = $A.setAttribute(domElement, "tabindex", 0); // Set multiple attributes on an array of DOM elements var myElementsArray = $A.setAttribute([domElement1, domElement2], { tabindex: -1, "aria-disabled": "true" }); // Set multiple attributes on multiple DOM elements referenced by a CSS selector var myElementsArray = $A.setAttribute('#myListbox[role="listbox"] *[role="option"][tabindex]', { "aria-selected": "false", tabindex: -1 }); // Or the same using chaining // Set an attribute on a DOM element var myChain = $A(domElement).setAttribute("tabindex", 0); // Set multiple attributes on an array of DOM elements var myChain = $A([domElement1, domElement2]).setAttribute({ tabindex: -1, "aria-disabled": "true" }); // Set multiple attributes on multiple DOM elements referenced by a CSS selector var myChain = $A('#myListbox[role="listbox"] *[role="option"][tabindex]').setAttribute({ "aria-selected": "false", tabindex: -1 }); // To return the modified element within a chain, use the "return()" method. var myElement = myChain.return();